<%if @user ==-1%>
<%else%>
<%if 	@user.typeUser!='0'%>
<%= link_to t(:usermana), users_path %>
</br>
<%= link_to t(:bookmana), booktables_path %>
</br>
<%= link_to t(:borrowmana), muonsaches_path %>
<%end%>
<%end%>
<h1><%= t :listbook%> </h1><br>
<% @booktables.each do |booktable| %>
<div class="view">
  <%= link_to image_tag(booktable.image, :border => 0,:width =>270, :height => 340), booktable%><br><br>
    $<%= booktable.nameBook %><br>
    <%if @user ==-1%>
    <%else%>
	    <%if 	@user.typeUser!='0'%>
	    <%= link_to t(:show), booktable %>|
	    <%= link_to t(:edit), edit_booktable_path(booktable) %>|
	    <%= link_to t(:destroy), booktable, confirm: t(:confirm), method: :delete %>
	    <%else%>
	    <% if booktable.quantity >1%>
	   <%= link_to t(:borrowbook), :controller => "muonsaches", :action => "new", :id => booktable.id%>
	    <%end%>
	    <%end%>
	     <%end%>
   </div>
<% end %>

